function v = DrawImgEllipse(v, x0, y0, A, B, phi)
   
sz = size(v);

% Draw the returned ellipse
t = linspace(0,pi*2);
x = A * cos(t);
y = B * sin(t);
nx = ceil(x*cos(phi)-y*sin(phi) + x0); 
ny = ceil(x*sin(phi)+y*cos(phi) + y0);
        
r = 255;
g = 255;
b = 255;
len = length(nx);

n = 1;

for i = 1:len    
    x = ny(i);
    y = nx(i);

    if (x - n) > 0 & (y - n) > 0 & (x + n) <= sz(1) & (y + n) <= sz(2) 
        v(x-n:x+n, y-n:y+n, 1) = r;
        v(x-n:x+n, y-n:y+n, 2) = g;
        v(x-n:x+n, y-n:y+n, 3) = b;   
    elseif x > 0 & y > 0 & x <= sz(1) & y <= sz(2)
        v(x, y, 1) = r;
        v(x, y, 2) = g;
        v(x, y, 3) = b;   
    end
end